package com.wangfugui.mybatisplus.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wangfugui.mybatisplus.common.PageRequest;
import com.wangfugui.mybatisplus.common.PageResult;
import com.wangfugui.mybatisplus.common.Result;
import com.wangfugui.mybatisplus.service.IBaseService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

public class BaseController<S extends IBaseService<T>, T> {

    @Autowired
    protected S service;

    /**
     * 通用分页方法
     */
    protected Result<PageResult<T>> successPage(IPage<T> page) {
        return Result.ofSuccess(new PageResult<>(page));
    }
}